import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

//配置路由
const router = new VueRouter({
  routes: [
    //路由重定向
    {
      path: "/",
      redirect: "/home", //路由重定向
    },
    //home 首页
    {
      path: "/home",
      name: "home",
      component: () => import("@/pages/home/index.vue"),
      meta: {
        title: 'home',
        showFooter: true,
        showHeader: true,
        center1: true,
        center2: false,
        arrowLeft: false, //返回按钮
        showPopup: true,
      },
    },
    //登录
    {
      path: "/login",
      name: "login",
      component: () => import("@/pages/login/index.vue"),
      meta: {
        title: "登录",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true, //返回按钮
      },
    },
    {
      path: "/logreg",
      name: "logreg",
      component: () => import("@/pages/login/logreg.vue"),
      meta: {
        title: "欢迎",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true, //返回按钮
      },
    },
    {
      path: "/register",
      name: "register",
      component: () => import("@/pages/login/register.vue"),
      meta: {
        title: "注册",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true, //返回按钮
      },
    },
    //play 播客
    {
      path: "/play",
      name: "play",
      component: () => import("@/pages/play/index.vue"),
      meta: {
        title: "",
        showFooter: true,
        showHeader: true,
        center1: false,
        arrowLeft: false,
        showPopup: true,
      },
      children: [
        {
          //听听
          path: "listen",
          component: () => import("@/pages/play/listen/index.vue"),
          meta: {
            title: "",
            showFooter: true,
            showHeader: true,
            center1: false,
            center2: true,
            showPlay: true,
            showPopup: true,
          },
        },
        {
          // 推荐
          path: "recommend",
          component: () => import("@/pages/play/recommend/index.vue"),
          meta: {
            title: "",
            showFooter: true,
            showHeader: true,
            center1: false,
            center2: true,
            showPlay: true,
            showPopup: true,
          },
        },
        {
          //分类
          path: "classify",
          component: () => import("@/pages/play/classify/index.vue"),
          meta: {
            title: "",
            showFooter: true,
            showHeader: true,
            center1: false,
            center2: true,
            showPlay: true,
            showPopup: true,
          },
        },
      ],
    },
    //mine 我的
    {
      path: "/mine",
      name: "mine",
      component: () => import("@/pages/mine/index.vue"),
      meta: {
        title: "",
        showFooter: true,
        showHeader: true,
        center1: false,
        center2: false,
        arrowLeft: false,
        showPopup: true,
      },
    },
    //focus 关注
    {
      path: "/focus",
      name: "focus",
      component: () => import("@/pages/focus/index.vue"),
      meta: {
        title: "",
        showFooter: true,
        showHeader: true,
        center1: false,
        center2: true,
        arrowLeft: false,
        showPopup: true,
      },
      children: [
        {
          //动态
          path: "dynamic",
          component: () => import("@/pages/focus/dynamic/index.vue"),
          meta: {
            title: "",
            showFooter: true,
            showHeader: true,
            center1: false,
            center2: true,
            showPlay: false,
            showPopup: true,
          },
        },
        {
          // 云圈
          path: "cloud",
          component: () => import("@/pages/focus/cloud/index.vue"),
          meta: {
            title: "",
            showFooter: true,
            showHeader: true,
            center1: false,
            center2: true,
            showPlay: false,
            showPopup: true,
          },
        },
      ],
    },
    //home页面下的四个子页面
    {
      path: "/daily",
      name: "daily",
      component: () => import("../pages/daily/index.vue"),
      meta: {
        title: "每日推荐",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    {
      path: "/fm",
      name: "fm",
      component: () => import("../pages/fm/index.vue"),
      meta: {
        title: "私人FM",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    {
      path: "/songsheet",
      name: "songsheet",
      component: () => import("../pages/songsheet/index.vue"),
      meta: {
        title: "歌单",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    {
      path: "/rank",
      name: "rank",
      component: () => import("../pages/rank/index.vue"),
      meta: {
        title: "排行榜",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    //排行音乐
    {
      path: "/ranklist",
      name: "ranklist",
      component: () => import("../pages/rankList/index.vue"),
      meta: {
        title: "排行音乐",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    //mine的子路由
    //创建歌单
    {
      path: "/creatlist/:id",
      name: "creatlist",
      component: () => import("../pages/mine/musiclist/creatlist.vue"),
      meta: {
        title: "创建歌单",
        showFooter: true,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    //收藏歌单
    {
      path: "/liststar/:id",
      name: "liststar",
      component: () => import("../pages/mine/musiclist/liststar.vue"),
      meta: {
        title: "收藏歌单",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    //歌单助手
    {
      path: "/listhelper/:id",
      name: "listhelper",
      component: () => import("../pages/mine/musiclist/listhelper.vue"),
      meta: {
        title: "歌单助手",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    //歌单详情(mine)
    {
      path: "/listdetail/:id",
      name: "listdetail",
      component: () => import("../pages/mine/musiclist/listdetail.vue"),
      meta: {
        title: "歌单详情",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    //喜欢列表(mine)
    {
      path: "/mylove/:id",
      name: "mylove",
      component: () => import("../pages/mine/musiclist/mylove.vue"),
      meta: {
        title: "我的喜欢",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    // wxw 的路由
    // 歌单详情
    {
      path: "/songlistdetail/:id",
      name: "Songlistdetail",
      component: () => import("../pages/songlistdetail/index.vue"),
      meta: {
        title: "歌单详情",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    //歌曲播放
    {
      path: "/songdetail/:id",
      name: "Songdetail",
      component: () => import("../pages/songdetail/index.vue"),
      meta: {
        title: "播放歌曲",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    {
      // 话题详情
      path: "/topic/:id",
      component: () => import("../pages/focus/dynamic/topicitem/index.vue"),
      meta: {
        title: "话题详情",
        showFooter: false,
        showHeader: true,
        center1: false,
        center2: false,
        showPlay: false,
        arrowLeft: true,
      },
    },
    {
      //ldp分类详情
      path: "/classifydetail/:id",
      component: () =>
        import("../pages/play/classify/classifydetail/index.vue"),
      meta: {
        title: "",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    {
      // 个人资料
      path: "/personal",
      component: () => import("../pages/personal/index.vue"),
      meta: {
        title: "个人资料",
        showFooter: false,
        showHeader: true,
        center1: false,
        center2: false,
        showPlay: false,
        arrowLeft: true,
      },
    },
    //以下是jh创建的路由
    {
      // 搜索
      path: "/search",
      component: () => import("../pages/search/index.vue"),
      children: [
        {
          path: "main",
          component: () => import("../pages/search/main/index.vue"),
          meta: {
            title: "搜索",
            showFooter: false,
            showHeader: true,
            center1: false,
            showPlay: false,
            arrowLeft: true,
          },
        },
        {
          path: "suggest",
          component: () => import("../pages/search/suggest/index.vue"),
          meta: {
            title: "搜索",
            showFooter: false,
            showHeader: true,
            center1: false,
            showPlay: false,
            arrowLeft: true,
          },
        },
      ],
    },
    {
      //歌手分类
      path: "/singerSort/",
      component: () => import("../pages/singerSort/index.vue"),
      meta: {
        title: "歌手分类",
        showFooter: false,
        showHeader: true,
        center1: false,
        showPlay: false,
        arrowLeft: true,
      },
    },
    {
      //歌手详情
      path: "/singerDetail/:id",
      component: () => import("../pages/singerDetail/index.vue"),
      meta: {
        title: "歌手详情",
        showFooter: false,
        showHeader: true,
        center1: false,
        showPlay: false,
        arrowLeft: true,
      },
    },
    //视频mv播放页面
    {
      //歌手详情
      path: "/singsmv/:id",
      component: () => import("../pages/singsmv/index.vue"),
      meta: {
        title: "MV播放",
        showFooter: false,
        showHeader: true,
        center1: false,
        showPlay: false,
        arrowLeft: true,
      },
    },
    //jkw 设置的路由
    //消息页
    {
      path: "/message",
      name: "message",
      component: () => import("@/pages/message/index.vue"),
      meta: {
        title: "消息",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    //粉丝页面
    {
      path: "/fans",
      name: "fans",
      component: () => import("@/pages/message/fans/index"),
      meta: {
        title: "粉丝",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    //评论页面
    {
      path: "/observer",
      name: "observer",
      component: () => import("@/pages/message/observer/index"),
      meta: {
        title: "评论",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    // @我
    {
      path: "/about",
      name: "about",
      component: () => import("@/pages/message/aboutme/index"),
      meta: {
        title: "@我",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    // 通知
    {
      path: "/inform",
      name: "inform",
      component: () => import("@/pages/message/inform/index"),
      meta: {
        title: "通知",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
      },
    },
    {
      // 用户关注列表
      path: "/attention",
      name: "attention",
      component: () => import("@/pages/attention/index"),
      meta: {
        title: "",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
        headerList: [
          { tit: "推荐", path: "/attention" },
          { tit: "关注", path: "/recommend" },
          { tit: "粉丝", path: "/fen" },
        ],
      },
    },
    {
      // 关注列表
      path: "/recommend",
      name: "recommend",
      component: () => import("@/pages/attention/recommend"),
      meta: {
        title: "关注",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
        headerList: [
          { tit: "推荐", path: "/attention" },
          { tit: "关注", path: "/recommend" },
          { tit: "粉丝", path: "/fen" },
        ],
      },
    },
    {
      // 粉丝列表
      path: "/fen",
      name: "fen",
      component: () => import("@/pages/attention/fen"),
      meta: {
        title: "粉丝",
        showFooter: false,
        showHeader: true,
        center1: false,
        arrowLeft: true,
        headerList: [
          { tit: "推荐", path: "/attention" },
          { tit: "关注", path: "/recommend" },
          { tit: "粉丝", path: "/fen" },
        ],
      },
    },
  ],
  linkActiveClass: "active", //自己设置class名
});

export default router;
